package cn.com.nes.site.controller.crm.opportunity.vo;

import cn.com.nes.site.entity.vo.BaseVO;
import cn.com.nes.site.service.crm.opportunity.bo.SaveOpportunityFileBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.BeanUtils;

@ApiModel(value = "商机文件保存入参模型")
@Data
public class SaveOpportunityFileVO extends BaseVO {
    @ApiModelProperty(value = "商机文件ID")
    private String uuid;

    @ApiModelProperty(value = "商机ID")
    @NotEmpty(message = "商机ID")
    private String opportunityId;

    @ApiModelProperty(value = "文件类型")
    @NotEmpty(message = "文件类型")
    private String fileType;

    @ApiModelProperty(value = "文件名")
    @NotEmpty(message = "文件名")
    private String fileName;

    @ApiModelProperty(value = "文件路径")
    @NotEmpty(message = "文件路径")
    private String filePath;

    @ApiModelProperty(value = "备注")
    private String memo;

    public SaveOpportunityFileBO convertToBo() {
        SaveOpportunityFileBO bo = new SaveOpportunityFileBO();
        BeanUtils.copyProperties(this, bo);
        bo.setOpportunityUuid(this.opportunityId);
        return bo;
    }
}
